<!-- 关联订单 -->
<template>
    <view class="container" :style="themeColor">
        <!-- 订单 -->
        <order :visible="visible" :isTemp="true" :orderId="id" />
    </view>
</template>

<script>
import Order from "./orderTemp.vue"
export default {
    components: {
        Order,
    },
    props: {
        visible: {
            type: Boolean,
            default: false,
        },
        refreshView: {
            type: Boolean,
            default: false,
        },
    },
    watch: {
        visible: {
            handler(newVal) {
                if (newVal) {
                    this.refreshViewFn()
                }
            },
            immediate: true,
        },
        refreshView(e) {
            if (e) {
                this.refreshViewFn()
            }
        },
    },
    onLoad(e) {
        this.id = e.id
    },
    data() {
        return {
            refreshOrder: false,
            id: "",
        }
    },

    methods: {
        refreshViewFn() {
            this.refreshOrder = false
            setTimeout((e) => {
                this.refreshOrder = true
            }, 50)
        },
    },
}
</script>

<style lang="scss" scoped></style>
